package com.ds.lens.data.common.apmapi;

import com.ds.lens.data.common.apmapi.in.ApmMetricInVO;
import com.ds.lens.data.common.apmapi.in.ConditionInBO;
import com.ds.lens.data.common.apmapi.in.SimpleApmMetricInVO;
import com.ds.lens.data.common.apmapi.in.TransactionNameApiInBO;
import com.ds.lens.data.common.apmapi.out.AggregationResultOutBO;
import com.ds.lens.data.common.apmapi.out.ApmMetricOutVO;
import com.ds.lens.data.common.apmapi.out.InstanceBO;
import com.ds.lens.data.common.apmapi.out.TransactionNameApiBO;
import feign.Headers;
import feign.Param;
import feign.RequestLine;

import java.util.List;
import java.util.Map;

public interface ApmMetricClient {
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("POST /server/v2/metrics/search")
    ApmMetricOutVO<AggregationResultOutBO[]> getMetricMetadata(ApmMetricInVO requestData) throws Exception;

    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("POST /server/v2/metrics/simple-search")
    ApmMetricOutVO<List<Map<String, Object>>> getMetricMetadataFromSimple(SimpleApmMetricInVO requestData) throws Exception;

    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("POST server/v2/transaction/snap/getTransactionListByAppInfo")
    ApmMetricOutVO<TransactionNameApiBO> getTransactionListByAppInfo(ConditionInBO<TransactionNameApiInBO> requestData) throws Exception;

    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("GET /agent/listInstanceByTierId?tierId={tierId}")
    ApmMetricOutVO<List<InstanceBO>> getInstancesByTierId(@Param(value = "tierId") String tierId) throws Exception;
}
